cmake_minimum_required(VERSION 2.8.3)
project(demo_video_processing)

# catkin_make构建时需要的组件包
find_package(catkin REQUIRED COMPONENTS
  message_generation
  roscpp
  std_msgs
  image_transport
  cv_bridge
  #sensor_msgs
)

#找到opencv的功能包
find_package(OpenCV REQUIRED)

#生成共享库
# add_library(${transform} SHARED Transform.cpp)
add_message_files(FILES
  pointinfo.msg
  point.msg
)
generate_messages(DEPENDENCIES
  std_msgs
)

## 设置包含目录
include_directories(include ${catkin_INCLUDE_DIRS})
include_directories(include ${OpenCV_INCLUDE_DIRS})
#include_directories(include "/home/chris/demo_video_processing/")
## catkin功能包选项，描述了库、catkin构建依赖项和系统依赖的功能包
catkin_package(CATKIN_DEPENDS roscpp std_msgs message_runtime)

## 配置可执行文件、目标链接库和其他依赖项

# target_link_libraries(transform ${catkin_LIBRARIES} ${OpenCV_LIBRARIES})
# add_dependencies(transform ${${PROJECT_NAME}_EXPORTED_TARGETS} ${catkin_EXPORTED_TARGETS})

add_executable(video_capture src/video_capture.cpp)  
target_link_libraries(video_capture ${catkin_LIBRARIES} ${OpenCV_LIBRARIES})

add_executable(image_show src/image_show.cpp)
target_link_libraries(image_show pertrans transform ${catkin_LIBRARIES} ${OpenCV_LIBRARIES})


add_executable(point_sub
  src/point_sub.cpp
)
add_dependencies(point_sub ${${PROJECT_NAME}_EXPORTED_TARGETS} ${catkin_EXPORTED_TARGETS})
target_link_libraries(point_sub
  ${catkin_LIBRARIES}
)

add_library(transform include/demo_video_processing/Transform.h
    src/Transform.cpp
)

add_library(pertrans include/demo_video_processing/pertrans.h
    src/pertrans.cpp
)

# add_library(pertrans src/pertrans.cpp
# )
# add_dependencies(pertrans ${${PROJECT_NAME}_EXPORTED_TARGETS} ${catkin_EXPORTED_TARGETS})
# target_link_libraries(pertrans
#   ${catkin_LIBRARIES}
# )


# add_dependencies(pertrans ${${PROJECT_NAME}_EXPORTED_TARGETS} ${catkin_EXPORTED_TARGETS})
# target_link_libraries(pertrans
#   ${catkin_LIBRARIES}
# )